package com.changgou.pay;

import com.github.wxpay.sdk.MyConfig;
import com.github.wxpay.sdk.WXPay;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;

/**
 * @author zero
 * @date 2020/7/13
 */

@SpringBootApplication
@EnableEurekaClient
public class PayApplication {

    public static void main(String[] args) {

        SpringApplication.run(PayApplication.class,args);

    }


    @Bean
    public WXPay wxPay(){
        //WXPay需要传递参数配置类
        MyConfig myConfig = new MyConfig();
        try {
            return new WXPay(myConfig);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

}
